<template>
  <div class="tableone">
    <el-table :data="tabledata">
      <el-table-column prop="name" label="名称" ></el-table-column>
      <el-table-column prop="value" label="监测值" width="60"></el-table-column>
      <el-table-column prop="warning" label="是否告警" width="80">
        <template slot-scope="scoped">
          <span :class="scoped.row.warning=='是'?'warning':''">
            {{scoped.row.warning}}
          </span>
        </template>
      </el-table-column>
      <el-table-column prop="frequency" label="监测频率"  width="80"></el-table-column>
      <el-table-column label="操作" width="50">
        <template>
          <span
            class="operation"
            :style="`background-image:url(${tablebg})`"
          ></span>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  props: {
    tabledata: {
      type: Array,
      required: false,
      default: "",
    },
    tablebg: {
      type: String,
      required: false,
      default: "",
    },
  },
  name: "eletable",
  data() {
    return {
      Array:[]
    };
  },
  methods: {

  },
  mounted() {
    this.Array = []
  },
};
</script>

<style  scoped>
.tableone >>> .el-table .el-table__body-wrapper tr:nth-child(even) {
  background: #003868 !important;
}
.tableone >>> .cell {
  font-size: 12px;
}
.tableone >>> .el-table__body-wrapper {
  height: 130px;
  overflow-y: auto;
}
.operation {
  display: block;
  width: 20px;
  height: 20px;
  margin: 0 auto;
  background-size: 100% 100%;
}
.warning{
  color: red;
}
</style>